function getNowTimeStr() {
  var currentDate = new Date();
  var year = currentDate.getFullYear();
  var month = (currentDate.getMonth() + 1).toString().padStart(2, "0");
  var day = currentDate.getDate().toString().padStart(2, "0");
  var hours = currentDate.getHours().toString().padStart(2, "0");
  var minutes = currentDate.getMinutes().toString().padStart(2, "0");
  var seconds = currentDate.getSeconds().toString().padStart(2, "0");
  return (
    "【" +
    year +
    "-" +
    month +
    "-" +
    day +
    " " +
    hours +
    ":" +
    minutes +
    ":" +
    seconds +
    "】  "
  );
}

export function PrintLog(logStr) {
  if (logStr == null || logStr == undefined || logStr == "") return;
  if (typeof logStr == "object") {
    logStr = JSON.stringify(logStr);
  }
  console.log(getNowTimeStr() + logStr);
}
